package cn.i7baozh.consumer.controller;

import cn.i7baozh.api.entities.CommonResult;
import cn.i7baozh.api.entities.Payment;
import cn.i7baozh.consumer.service.PaymentFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : baoqi.zhang
 * @date :   2022/4/8 11:24
 */
@RestController
@Slf4j
public class Controller {

    @Autowired
    private PaymentFeignService paymentFeignService;

    @GetMapping("/consumer/health")
    public String health() {
//        log.info("health");
        return "UP";
    }
    @GetMapping("/consumer/feign")
    public String create() {
        log.info("info");
        return paymentFeignService.getPaymentInfo();
    }
    @GetMapping("/consumer/abc")
    public CommonResult<String> abc() {
        log.info("abc");
        return paymentFeignService.abc();
    }

    @GetMapping("/consumer/timeout")
    public String timeout() {
        log.info("abc");
        return paymentFeignService.paymentTimeout();
    }
}
